Create a dashboard.yml file for all plots for the current project/scenario

The purpose of this notebook is to create a dashboard.yml file in the {general:project} folder that has a dashboard for each category of plots and inside that dashboard, one plot for each plot in that category. We use the row-layout for the dashboards.

Imports


In [5]:
from __future__ import division, print_function

import yaml
import cea.config
import cea.plots
import cea.plots.cache
import cea.plots.categories

main variables


In [8]:
config = cea.config.Configuration()
plot_cache = cea.plots.cache.NullPlotCache()

In [10]:
for category in cea.plots.categories.list_categories():
    # create the new dashboard
    dashboard_index = cea.plots.new_dashboard(config, plot_cache, category.label, "row")
    dashboards = cea.plots.read_dashboards(config, plot_cache)
    dashboard = dashboards[dashboard_index]
    
    for plot_class in category.plots:        
        dashboard.add_plot(category.name, plot_class.id())        
    cea.plots.write_dashboards(config, dashboards)